Skip to main content
llama-server is a fast, lightweight HTTP server that provides an OpenAI-compatible REST API for LLM inference. It is built on httplib and exposes a WebUI, parallel decoding, function calling, speculative decoding, and embeddings — all from a single binary.

What llama-server provides

OpenAI-compatible API

Drop-in replacement for the OpenAI REST API. Point any OpenAI client at your local server without code changes.

Built-in WebUI

Interact with the model directly in your browser at http://127.0.0.1:8080.

Parallel decoding

Serve multiple users simultaneously with continuous batching and configurable parallel slots.

Function calling

Tool use for virtually any model via Jinja template support. See the function calling docs.

Speculative decoding

Accelerate token generation using a draft model or ngram-based speculation.

Embeddings

Generate text embeddings via the /v1/embeddings endpoint for retrieval-augmented workflows.

Basic usage

CPU inference

GPU inference

Add -ngl 999 to offload all layers to VRAM:
Once the server starts, open http://127.0.0.1:8080 in your browser to access the WebUI.
Never expose the server directly to the internet without authentication. By default the server binds to 127.0.0.1 (localhost only). If you need network access, use --host 0.0.0.0 together with --api-key to require authentication.

Server options

Default: 127.0.0.1IP address the server listens on. Change to 0.0.0.0 to accept connections from other machines on your network.
Default: 8080Port the server listens on.
Default: autoControls which WebUI to serve. Options:
Default: none (no authentication)Require clients to supply an API key via the Authorization: Bearer <key> header.
Default: noneSet the model name alias returned by the API. Useful when a client hard-codes a specific model name.
Default: 1Number of parallel decode slots. Enables serving multiple users simultaneously. The total context (--ctx-size) is shared across all slots.

API endpoints

Chat & completions

Monitoring

Example: chat completions request

With an API key:

Full startup example